<!DOCTYPE html>
<html lang="zh-cn" ng-app="bookstoreApp">
<head>
	<title>bookstore</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="css/site.css">
</head>

<!-- <body class="container" ng-controller="bookListController"> -->
<body class="container">

	<!-- <header class="page-header">
		<h1><small>{{"Hi" + " " + "BookStore"}}</small></h1>
	</header> -->

	<div ng-include="'_header.html'"></div>

	<!-- bookList  bookDetail -->
	<div ng-view></div>
	
</body>

<script src="http://cdn.bootcss.com/angular.js/1.5.0/angular.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.5.0/angular-route.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.5.0/angular-resource.js"></script>
<script src="http://cdn.bootcss.com/angular.js/1.5.0/angular-animate.js"></script>

<script src="js/bookstoreRoutes.js"></script>
<script src="js/bookstoreService.js"></script>
<script src="js/bookstoreFilters.js"></script>
<script src="js/bookstoreController.js"></script>
<script src="js/bookstoreApp.js"></script>

<script type="text/javascript">

	/*var bookstoreApp = angular.module("bookstoreApp",["ngRoute","ngResource","ngAnimate"]);*/
	/*var bookstoreApp = angular.module("bookstoreApp",["bookstoreRoutes","bookstoreService","bookstoreFilters","bookstoreController","ngAnimate"]);*/

	/*
	//检查状态 过滤器
	//定制 Filter 模块
	bookstoreApp
		.filter("checkStatusFilter",function(){
			return function(status){
				return status==true?"正常出售":"暂无库存";
			};
		})
		.filter("getStatusLabelFilter",function(){
			return function(status){
				return status==true?"label-success":"label-danger";
			};
		});
	*/


	/*

	//代码重构之后 将在 js/bookstoreService.js 
	//模块化开发 直接将模块 bookstoreService 导入bookstoreApp = angular.module("bookstoreApp",["ngRoute","bookstoreService","ngAnimate"]);

	//资源请求服务 [包装了 $http 服务]

	//定制 Service 模块

	bookstoreApp.factory('bookstoreService',function($resource){
		return $resource("db/:id.json");
	});
	*/

	/*
	//配置路由
	//定制 Routes 模块
	bookstoreApp.config(function($routeProvider){
		$routeProvider
			.when("/",{
				templateUrl : "bookList-res.html",
				controller : "bookListController"
			})
			.when("/:id",{
				templateUrl : "bookDetail.html",
				controller : "bookDetailController"
			})
			.otherwise({
				redirectTo:"/"
			});
	});
	*/

	/*
	//获取所有的book [通过 ng-resource]
	//定制 Controller 模块
	bookstoreApp.controller("bookListController",function($scope,bookstoreService){

		$scope.books = bookstoreService.get({id:"books"});

		$scope.orderByProp = "title";
	});

	//获取书的详细信息 [通过 ng-resource] 
	bookstoreApp.controller("bookDetailController",function($scope,$routeParams,bookstoreService){
		//$scope.id = $routeParams.id;
		$scope.book = bookstoreService.get({id:$routeParams.id});

		$scope.cover = $routeParams.id;
		$scope.setCover = function(id){
			$scope.cover = id;
		}
	});
	*/
</script>

</html>